#include "qleditem.h"

QLedItem::QLedItem(QStringList header,QStringList values)
	: QBDDItem(header,values)
{
	#ifdef	LOG_ACTIVATED
	__TRACE__
	#endif
	#ifdef	LEAK_ACTIVATED
	__LEAK__
	#endif
	m_type = PART_LED;
	m_bddFile = DB_LED_FILE;

	if(header.contains(LA_DESC))
	{
		QString desc = values[header.indexOf(LA_DESC)];
		m_properties[PART_PACKAGE]		= extractFrom(desc,RE_PACKAGE);
		m_properties[PART_LED_COLOR]	= extractFrom(desc,RE_LED_COLOR);
	}
	else
		m_properties[PART_PACKAGE] = m_properties[PART_LED_COLOR] = PART_UNKNOWN;
}

QLedItem::QLedItem(QByteArray in)
	: QBDDItem(in)
{
	#ifdef	LOG_ACTIVATED
	__TRACE__
	#endif
	#ifdef	LEAK_ACTIVATED
	__LEAK__
	#endif
	m_type = PART_LED;
   m_bddFile = DB_LED_FILE;
}

QLedItem::~QLedItem()
{
	#ifdef	LOG_ACTIVATED
	__TRACE__
	#endif
	#ifdef	LEAK_ACTIVATED
	__LEAK__
	#endif
}

QStringList QLedItem::cat_1() 
{ 
	#ifdef	LOG_ACTIVATED
	__TRACE__
	#endif
	#ifdef	LEAK_ACTIVATED
	__LEAK__
	#endif
	QStringList list;
	list << LA_LED_TYPE_1; 
	return list; 
}

QStringList QLedItem::cat_2()
{ 
	#ifdef	LOG_ACTIVATED
	__TRACE__
	#endif
	#ifdef	LEAK_ACTIVATED
	__LEAK__
	#endif
	QStringList list;
	list << LA_LED_TYPE_2; 
	return list; 
}